name: Run Gradle
description: Sets up Gradle JDKs and runs Gradle
inputs:
  arguments:
    required: true
    description: Gradle arguments
    default: build
runs:
  using: "composite"
  steps:
    - uses: actions/setup-java@v4
      id: setup-gradle-jdk
      with:
        distribution: temurin
        java-version: 21
        check-latest: true
    - uses: gradle/actions/setup-gradle@v3
    - shell: bash
      env:
        JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }}
      run: |
        ./gradlew \
        -Porg.gradle.java.installations.auto-download=false \
        -Pjunit.develocity.predictiveTestSelection.enabled=${{ github.event_name == 'pull_request' }} \
        "-Dscan.value.GitHub job=${{ github.job }}" \
        javaToolchains \
        ${{ inputs.arguments }}
